package com.android.footprint;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.acitivity_main);
        
        ComponentName bootReceiver = new ComponentName(this, BootReceiver.class);
        ComponentName connReceiver = new ComponentName(this, ConnReceiver.class);
        PackageManager pm = getPackageManager();
        pm.setComponentEnabledSetting(bootReceiver,
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP);
        pm.setComponentEnabledSetting(connReceiver,
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP);
        
        Intent intent = new Intent(this, GeneralService.class);
        startService(intent);
    }
    
    public void onConfirmClick(View v) {
        finish();
    }
}
